CMAKE_MINIMUM_REQUIRED(VERSION 3.17)
PROJECT(EpubZlib)

SET(CMAKE_CXX_EXTENSIONS OFF)
SET(CMAKE_CXX_STANDARD 17)

ADD_SUBDIRECTORY(m_thty/mini_zlib)

ADD_LIBRARY(EpubZlib SHARED m_apps/library.cpp)
TARGET_LINK_LIBRARIES(EpubZlib LIBRARIES::MINIZLIB)
SET_TARGET_PROPERTIES(EpubZlib PROPERTIES PUBLIC_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/m_apis/epub_zlib_api.h")

ADD_EXECUTABLE(EpubZlibTest1 m_apps/test1.cpp)
TARGET_LINK_LIBRARIES(EpubZlibTest1 EpubZlib)

INSTALL(TARGETS EpubZlib EpubZlibTest1
        LIBRARY DESTINATION lib
        ARCHIVE DESTINATION lib
        RUNTIME DESTINATION bin
        PUBLIC_HEADER DESTINATION include)
